package org.lanqiao.tjut.outputerservice;

import java.util.Date;
import java.util.logging.Level;
import java.util.logging.Logger;

import org.lanqiao.tjut.outputer.ISpokesman;
import org.lanqiao.tjut.outputerImpl.EducationSpokesman;


public class EducationSpokesmanProxy implements ISpokesman {

	// 代理类内部引用委托类
	private EducationSpokesman eSpeaker;
	

	/**
	 * 默认的构造方法 
	 */
	public EducationSpokesmanProxy() {
	}

	public EducationSpokesman geteSpeaker() {
		return eSpeaker;
	}

	public void seteSpeaker(EducationSpokesman eSpeaker) {
		this.eSpeaker = eSpeaker;
	}

	@Override
	public void doSpeaking() {
		Logger.getLogger(this.getClass().getSimpleName()).log(Level.INFO, new Date().toLocaleString() + " 新闻发布会马上开始.");
		// 代理类调用被托管类的具体业务方法，来代为管理整体流程，被托管类则需要只关注于自身业务内容即可
		eSpeaker.doSpeaking();
		Logger.getLogger(this.getClass().getSimpleName()).log(Level.INFO, new Date().toLocaleString() + " 新闻发布会结束.");

	}
}
